package practice2;


import utils.array.Queue;
import utils.array.Stack;

/**
 * @author Tara
 * @implNote  测试实现栈，使用数组实现栈；
 */
public class Pra8 {
    public static void main(String[] args) {

        Stack stack = new Stack(7);
        System.out.println("初始化:"+ stack);
        System.out.println("填充的值为：");
        for (int i = 0; i < 7; i++) {
            stack.push(i+3);
            System.out.print(i+3+",");
        }
        System.out.println("");
        System.out.print("移除的元素为：");
        for (int i = 0; i < 2; i++) {
            System.out.print(stack.pop()+",");
        }
        System.out.println("");
        System.out.println("移除之后的队列"+ stack);
        System.out.print("新增的两个元素：");
        for (int i = 0; i < 2; i++) {
            stack.push(10+i);
            System.out.print(10+i+"，");
        }
        System.out.println("");
        System.out.println("新增2个元素之后的队列："+ stack);
    }

}
